﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using Konekcija.Core.Reporting.Dto.Application.Meta;

namespace Konekcija.Core.Reporting.Mappings.Meta
{
    public class ItemDirectionMap : ClassMap<ItemDirection>
    {
        public ItemDirectionMap()
        {
            Schema("meta");
            Table("ItemDirections");

            Id(x => x.Id).GeneratedBy.GuidComb().Not.Nullable();
            Map(x => x.DirectionName).Nullable();
            Map(x => x.DateCreated).Nullable();

            // content
            HasMany(x => x.Items)
                .LazyLoad()
                .Inverse()
                .AsBag()
                .Key(k => k.Not.Nullable())
                .KeyColumn("DirectionId");
        }
    }
}
